from pptx import Presentation
from pptx.util import Inches

# 创建一个空的PPT演示文稿
prs = Presentation()

# 添加一个幻灯片
slide_layout = prs.slide_layouts[0]  # 使用默认的幻灯片布局
slide = prs.slides.add_slide(slide_layout)

# 添加标题
title = slide.shapes.title
title.text = "我的PPT标题"

# 添加副标题
subtitle = slide.placeholders[1]
subtitle.text = "这是我的副标题"

# 保存PPT文件
prs.save('example_ppt.pptx')